package com.tang.utils;

import java.text.SimpleDateFormat;

/**
 * @Author TangBowen
 * @create 2021/6/8 13:19
 */
public class DateUtil {
    /**
     *str转date方法
     */
    public static java.sql.Date StringToDate(String sDate) {

        String str = sDate;
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        java.util.Date d = null;
        try {
            d = format.parse(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        java.sql.Date date = new java.sql.Date(d.getTime());
        return date;
    }
}
